<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../include/laypublic.jsp" %>
<!DOCTYPE html>
<html>
<head>
</head>
<title>投标管理</title>
<style type="text/css">
    .layui-form-select dl {
        max-height: 150px;
    / / 原值为300，调节高度建议为50的倍数
    }

    .layui-form-label {
        width: 60px;
    }

    .flex {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        margin-left: 50px !important;
        line-height: 1;
    }

    .flex span {
        line-height: 1;
        margin-right: 10px;
    }
</style>
</head>
<body>
<div class="layui-tab layui-tab-brief" lay-filter="yxlx-tab-all">
    <ul class="layui-tab-title">
        <li id="tbglId" class="layui-this" lay-id="0">投标管理</li>
        <li id="zgysId" lay-id="1">资格预审</li>
        <li id="zbwjfxId" lay-id="2">招标文件分析</li>
        <li id="bschId" lay-id="3">标书策划</li>
        <li id="tbjcId" lay-id="4">投标决策</li>
        <li id="tbbzjId" lay-id="5">投标保证金</li>
        <li id="bspsId" lay-id="6">标书评审</li>
        <li id="kbjgId" lay-id="7">开标结果</li>
        <li id="bhzjId" lay-id="8">标后总结</li>
        <li id="xmjdId" lay-id="9">项目交底</li>
        <li id="tbbtId" lay-id="10">投标补贴</li>
    </ul>
    <div class="layui-tab-content" style="height: 100px;">
        <!-- 投标管理 -->
        <!-- ************************************************* 投标管理 *********************************************************** -->
        <div class="layui-tab-item layui-show">
            <%@ include file="bmdetail/bidManageList.jsp" %>
        </div>

        <!-- 资格预选 -->
        <!-- ************************************************* 资格预选 *********************************************************** -->
        <div class="layui-tab-item">
            <%@ include file="bmdetail/prequalificationList.jsp" %>
        </div>

        <!-- 招标文件分析 -->
        <!-- ************************************************* 招标文件分析 *********************************************************** -->
        <div class="layui-tab-item">
            <%@ include file="bmdetail/bidFileAnalysisList.jsp" %>
        </div>

        <!-- 标书策划 -->
        <!-- ************************************************* 标书策划 *********************************************************** -->
        <div class="layui-tab-item">
            <%@ include file="bmdetail/bidPlanList.jsp" %>
        </div>

        <!-- 投标决策 -->
        <!-- ************************************************* 投标决策 *********************************************************** -->
        <div class="layui-tab-item">
            <%@ include file="bmdetail/bidDecisionList.jsp" %>
        </div>

        <!-- 投标保证金 -->
        <!-- ************************************************* 投标保证金 *********************************************************** -->
        <div class="layui-tab-item">
            <%@ include file="bmdetail/bidSecurityList.jsp" %>
        </div>

        <!-- 标书评审 -->
        <!-- ************************************************* 标书评审 *********************************************************** -->
        <div class="layui-tab-item">
            <%@ include file="bmdetail/bidAuditList.jsp" %>
        </div>

        <!-- 开标结果 -->
        <!-- ************************************************* 开标结果 *********************************************************** -->
        <div class="layui-tab-item">
            <%@ include file="bmdetail/openBidResList.jsp" %>
        </div>

        <!-- 标后总结 -->
        <!-- ************************************************* 标后总结 *********************************************************** -->
        <div class="layui-tab-item">
            <%@ include file="bmdetail/summaryAfterBidList.jsp" %>
        </div>

        <!-- 项目交底 -->
        <!-- ************************************************* 项目交底 *********************************************************** -->
        <div class="layui-tab-item">
            <%@ include file="bmdetail/projectDiscloseList.jsp" %>
        </div>

        <!-- 投标补贴 -->
        <!-- ************************************************* 项目补贴 *********************************************************** -->
        <div class="layui-tab-item">
            <%@ include file="bmdetail/bidSubsidyList.jsp" %>
        </div>
    </div>
</div>

<script>
    layui.config({
        base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table', 'set', 'transfer', 'laydate', 'element', 'layer'], function () {
        var $ = layui.$
            , form = layui.form
            , table = layui.table
            , element = layui.element
            , laydate = layui.laydate
            , layer = layui.layer;

        loadTable('tbgl', 1, '0');

        //选项卡切换监听
        element.on('tab(yxlx-tab-all)', function (data) {
            var layId = $(this).attr('lay-id');
            if (layId === "0") {
                loadTable('tbgl', 1, layId);
            } else if (layId === "1") {
                loadTable('zgys', 2, layId);
            } else if (layId === "2") {
                loadTable('zbwjfx', 2, layId);
            } else if (layId === "3") {
                loadTable('bsch', 2, layId);
            } else if (layId === "4") {
                loadTable('tbjc', 2, layId);
            } else if (layId === "5") {
                loadTable('tbbzj', 2, layId);
            } else if (layId === "6") {
                loadTable('bsps', 2, layId);
            } else if (layId === "7") {
                loadTable('kbjg', 2, layId);
            } else if (layId === "8") {
                loadTable('bhzj', 2, layId);
            } else if (layId === "9") {
                loadTable('xmjd', 2, layId);
            } else if (layId === "10") {
                loadTable('tbbt', 2, layId);
            }
        });

        function loadTable(tabTag, dateFlag, layId) {
            if (dateFlag == 1) {
                //日期
                laydate.render({
                    elem: '#' + tabTag + '-laydate-date'
                });
            } else {
                //日期
                laydate.render({
                    elem: '#' + tabTag + '-laydate-dates'
                    , range: '~'
                });
            }

            var colsData;
            var reqUrl;
            var viewUrl;
            var pageTitle;
            if (layId === "0") {
                reqUrl = basePath + '/bidManage/queryDataByCondition'; //请求数据接口
                colsData = [
                    {field: 'compName', title: '区域公司', width: 150}
                    , {field: 'proName', title: '项目名称', width: 150}
                    , {
                        field: 'inquiryType',
                        title: '资格预审',
                        event: '0',
                        width: 150,
                        align: 'center',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.inquiryType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.inquiryType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.inquiryType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.inquiryId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }
                    , {
                        field: 'analysisType',
                        title: '招标文件分析',
                        event: '1',
                        width: 150,
                        align: 'center',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.analysisType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.analysisType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.analysisType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.analysisId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }
                    , {
                        field: 'planType',
                        title: '标书策划',
                        event: '2',
                        width: 150,
                        align: 'center',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.planType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.planType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.planType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.planId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }
                    , {
                        field: 'decisionType',
                        title: '投标决策',
                        event: '3',
                        width: 150,
                        align: 'center',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.decisionType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.decisionType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.decisionType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.decisionId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }
                    , {
                        field: 'bondApplyType',
                        title: '投标保证金支付申请',
                        event: '4',
                        width: 150,
                        align: 'center',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.bondApplyType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.bondApplyType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.bondApplyType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.bondApplyId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }
                    //
                    , {
                        field: 'ifmtbcType',
                        title: '资信标',
                        width: 150,
                        event: '10',
                        align: 'center',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.creditType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.creditType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.creditType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.creditId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }
                    , {
                        field: 'techbidType',
                        title: '技术标',
                        event: '11',
                        width: 150,
                        align: 'center',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.technoLogyType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.technoLogyType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.technoLogyType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.technoLogyId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }
                    , {
                        field: 'busiStandType',
                        title: '商务标',
                        width: 150,
                        align: 'center',
                        event: '5',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.busiStandType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.busiStandType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.busiStandType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.busiStandId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }

                    , {
                        field: 'resultType',
                        title: '开标结果',
                        width: 150,
                        align: 'center',
                        event: '6',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.resultType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.resultType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.resultType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.resultId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }
                    , {
                        field: 'summaryType',
                        title: '标后总结',
                        width: 150,
                        align: 'center',
                        event: '7',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.summaryType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.summaryType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.summaryType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.summaryId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }

                    , {
                        field: 'discloseType',
                        title: '项目交底',
                        width: 150,
                        align: 'center',
                        event: '8',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.discloseType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.discloseType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.discloseType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.discloseId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }
                    , {
                        field: 'subsidyType',
                        title: '投标补贴',
                        width: 150,
                        align: 'center',
                        event: '9',
                        templet: function (d) {
                            var optStr = "";
                            //1=审批中 9=审批完成 10=审批终止
                            if (d.subsidyType == 1) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,93,36)">ニ</span>';
                            } else if (d.subsidyType == 9) {
                                optStr += '<span style="font-size: 25px;color: rgb(59,177,156)">✓</span>';
                            } else if (d.subsidyType == 10) {
                                optStr += '<span style="font-size: 25px;color: rgb(225,6,6)">ㄨ</span>';
                            } else if (d.subsidyId) {
                                optStr += ' <span style="font-size: 35px;color: rgb(22,168,225);margin-top: -5px">○</span>';
                            }
                            return optStr;
                        }
                    }
                ];
            } else if (layId === "1") {
                reqUrl = basePath + '/inquiryPro/queryDataByCondition'; //请求数据接口
                viewUrl = basePath + '/inquiryPro/toDealOrDetail';
                pageTitle = "资格预审";
                colsData = [
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'proCode', title: '项目编码', width: 145}
                    , {field: 'orgAreaName', title: '区域公司', width: 145}
                    , {field: 'proName', title: '项目名称'}
                    , {field: 'sgCityName', title: '项目城市', width: 155}
                    , {
                        field: 'addTime', title: '创建时间', width: 160, templet: function (d) {
                            return layui.util.toDateString(d.addTime, "yyyy-MM-dd");
                        }
                    }
                    , {field: 'staffName', title: '营销经理', width: 100}
                    , {
                        field: 'qualificationType', title: '资审类型', width: 150, templet: function (d) {
                            if (d.qualificationType == '0') {
                                return '资格预审';
                            } else if (d.qualificationType == '1') {
                                return '资格后审';
                            } else {
                                return '';
                            }
                        }
                    }
                    , {
                        field: 'processStatus', title: '单据状态', width: 150, templet: function (d) {
                            if (d.processStatus == '1') {
                                return '审批中';
                            } else if (d.processStatus == '9') {
                                return '审批完成';
                            } else if (d.processStatus == '10') {
                                return '审批终止';
                            } else {
                                return ''
                            }
                        }
                    }
                    , {
                        title: '操作', width: 140, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>详情</a>';
                            return optStr;
                        }
                    }
                ];
            } else if (layId === "2") {
                reqUrl = basePath + '/bidAnalysis/queryDataByCondition'; //请求数据接口
                viewUrl = basePath + "/bidAnalysis/toDealOrDetail";
                pageTitle = "招标文件分析";
                colsData = [
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'proCode', title: '项目编码', width: 145}
                    , {field: 'compName', title: '区域公司', width: 145}
                    , {field: 'proName', title: '项目名称'}
                    , {field: 'cityName', title: '项目城市', width: 155}
                    , {
                        field: 'addTime', title: '创建时间', width: 160, templet: function (d) {
                            return layui.util.toDateString(d.addTime, "yyyy-MM-dd");
                        }
                    }
                    , {field: 'staffName', title: '营销经理', width: 100}
                    , {field: 'bondMoney', title: '投标保证金', width: 150}
                    , {
                        field: 'processStatus', title: '单据状态', width: 150, templet: function (d) {
                            if (d.processStatus == '1') {
                                return '审批中';
                            } else if (d.processStatus == '9') {
                                return '审批完成';
                            } else if (d.processStatus == '10') {
                                return '审批终止';
                            } else {
                                return ''
                            }
                        }
                    }
                    , {
                        title: '操作', width: 140, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>详情</a>';
                            return optStr;
                        }
                    }
                ];
            } else if (layId === "3") {
                reqUrl = basePath + '/bidPlan/queryDataByCondition'; //请求数据接口
                viewUrl = basePath + "/bidPlan/toDealOrDetail";//详情
                pageTitle = "标书策划";
                colsData = [
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'proCode', title: '项目编码', width: 145}
                    , {field: 'orgAreaName', title: '区域公司', width: 145}
                    , {field: 'proName', title: '项目名称', width: 145}
                    , {field: 'sgCityName', title: '项目城市', width: 155}
                    , {
                        field: 'addTime', title: '创建时间', width: 160, templet: function (d) {
                            if (d.addTime != null) {
                                return layui.util.toDateString(d.addTime, "yyyy-MM-dd");
                            } else {
                                return '暂无时间';
                            }

                        }
                    }
                    , {field: 'hrStaffName', title: '营销经理', width: 60}
                    , {field: 'bondMoney', title: '投标保证金', width: 150}
                    , {
                        field: 'processStatus', title: '单据状态', width: 150, templet: function (d) {
                            if (d.processStatus == '1') {
                                return '审批中';
                            } else if (d.processStatus == '9') {
                                return '审批完成';
                            } else if (d.processStatus == '10') {
                                return '审批终止';
                            } else {
                                return ''
                            }
                        }
                    }
                    , {
                        title: '操作', width: 140, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>详情</a>';
                            return optStr;
                        }
                    }
                ];
            } else if (layId === "4") {
                reqUrl = basePath + '/bidDecision/queryDataByCondition'; //请求数据接口
                viewUrl = basePath + '/bidDecision/toDealOrDetail';
                pageTitle = '投标决策';
                colsData = [
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'proCode', title: '项目编码', width: 145}
                    , {field: 'orgAreaName', title: '区域公司', width: 145}
                    , {field: 'proName', title: '项目名称', width: 145}
                    , {field: 'sgCityName', title: '项目城市', width: 155}
                    , {
                        field: 'addTime', title: '创建时间', width: 160, templet: function (d) {
                            if (d.addTime != null) {
                                return layui.util.toDateString(d.addTime, "yyyy-MM-dd");
                            } else {
                                return '暂无时间';
                            }
                        }
                    }
                    , {field: 'staffName', title: '营销经理', width: 100}
                    , {field: 'costMoney', title: '营销费用', width: 100}
                    , {
                        field: 'processStatus', title: '单据状态', width: 150, templet: function (d) {
                            if (d.processStatus == '1') {
                                return '审批中';
                            } else if (d.processStatus == '9') {
                                return '审批完成';
                            } else if (d.processStatus == '10') {
                                return '审批终止';
                            } else {
                                return ''
                            }
                        }
                    }
                    , {
                        title: '操作', width: 140, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>详情</a>';
                            return optStr;
                        }
                    }
                ];
            } else if (layId === "5") {
                // bidBondApply/toDealOrDetailAp/bidBondApplyply
                reqUrl = basePath + '/bidBondApply/queryDataByCondition'; //请求数据接口
                viewUrl = basePath + '/bidBondApply/toDealOrDetail';
                pageTitle = '投标保证金';
                colsData = [
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'proCode', title: '项目编码', width: 145}
                    , {field: 'orgAreaName', title: '区域公司', width: 145}
                    , {field: 'proName', title: '项目名称'}
                    , {field: 'sgCityName', title: '项目城市', width: 155}
                    , {
                        field: 'addTime', title: '创建时间', width: 160, templet: function (d) {
                            return layui.util.toDateString(d.addTime, "yyyy-MM-dd");
                        }
                    }
                    , {field: 'staffName', title: '营销经理', width: 100}
                    , {field: 'bondMoney', title: '投标保证金', width: 150}
                    , {
                        field: 'processStatus', title: '状态', width: 150, templet: function (d) {
                            if (d.processStatus == '1') {
                                return '审批中';
                            } else if (d.processStatus == '9') {
                                return '审批完成';
                            } else if (d.processStatus == '10') {
                                return '审批终止';
                            } else {
                                return ''
                            }
                        }
                    }
                    , {
                        field: 'documentsState', title: '单据状态', width: 150, templet: function (d) {
                            if (d.documentsState == '1') {
                                return '已付款';
                            } else if (d.documentsState == '2') {
                                return '未付款';
                            } else if (d.documentsState == '9') {
                                return '已回收';
                            } else if (d.documentsState == '10') {
                                return '部分回收';
                            } else {
                                return ''
                            }
                        }
                    }
                    , {
                        title: '操作', width: 200, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>详情</a>';
                            if (d.processStatus == '1' || d.processStatus == '9' || d.processStatus == '10') {
                                optStr += '<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="recyclingMargin">回收保证金</a>';
                            }
                            return optStr;
                        }
                    }
                ];
            } else if (layId === "6") {
                reqUrl = basePath + '/bidReview/queryDataByCondition'; //请求数据接口
                colsData = [
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'proCode', title: '项目编码', width: 145}
                    , {field: 'orgAreaName', title: '区域公司', width: 145}
                    , {field: 'proName', title: '项目名称'}
                    , {field: 'sgCityName', title: '项目城市', width: 155}
                    , {
                        field: 'addTime', title: '创建时间', width: 160, templet: function (d) {
                            return layui.util.toDateString(d.addTime, "yyyy-MM-dd");
                        }
                    }
                    , {field: 'staffName', title: '营销经理', width: 100}
                    , {
                        field: 'bidType', title: '标书类型', width: 150, templet: function (d) {
                            //1-资信标，2-商务标，3-技术标
                            var bidType = '';
                            if (d.bidType == '1') {
                                bidType = '资信标'
                            } else if (d.bidType == '2') {
                                bidType = '商务标'
                            } else if (d.bidType == '3') {
                                bidType = '技术标'
                            } else {
                                bidType = ''
                            }
                            return bidType
                        }
                    }
                    , {
                        field: 'processStatus', title: '单据状态', width: 150, templet: function (d) {
                            if (d.processStatus == '1') {
                                return '审批中';
                            } else if (d.processStatus == '9') {
                                return '审批完成';
                            } else if (d.processStatus == '10') {
                                return '审批终止';
                            } else {
                                return ''
                            }
                        }
                    },
                    {
                        title: '操作', width: 140, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="tenderReview"><i class="layui-icon layui-icon-form"></i>详情</a>';
                            return optStr;
                        }
                    }
                ];
            } else if (layId === "7") {
                reqUrl = basePath + '/bidOpenResult/queryDataByCondition'; //请求数据接口
                viewUrl = basePath + '/bidOpenResult/toDealOrDetail';
                pageTitle = "开标结果";
                colsData = [
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'proCode', title: '项目编码', width: 145}
                    , {field: 'orgAreaName', title: '区域公司'}
                    , {field: 'proName', title: '项目名称', width: 145}
                    , {field: 'sgCityName', title: '项目城市', width: 155}
                    , {
                        field: 'addTime', title: '创建时间', width: 160, templet: function (d) {
                            if (d.addTime != null) {
                                return layui.util.toDateString(d.addTime, "yyyy-MM-dd");
                            } else {
                                return '暂无时间';
                            }
                        }
                    }
                    , {field: 'hrStaffName', title: '营销经理', width: 100}
                    , {
                        field: 'bidding', title: '是否中标', width: 100, templet: function (d) {
                            var statusDidding = '';
                            if (d.bidding == '1') {
                                statusDidding = '是'
                            } else if (d.bidding == '0') {
                                statusDidding = '否'
                            } else {
                                statusDidding = ''
                            }
                            return statusDidding
                        }
                    }
                    , {
                        field: 'biddingStatus', title: '投标状态', width: 120, templet: function (d) {
                            var statusDiddingStatus = '';
                            if (d.biddingStatus == '0') {
                                statusDiddingStatus = '投标中'
                            } else if (d.biddingStatus == '1') {
                                statusDiddingStatus = '已开标'
                            } else if (d.biddingStatus == '2') {
                                statusDiddingStatus = '已中标未交底'
                            } else if (d.biddingStatus == '3') {
                                statusDiddingStatus = '已中标已交底'
                            } else if (d.biddingStatus == '4') {
                                statusDiddingStatus = '未中标未总结'
                            } else if (d.biddingStatus == '5') {
                                statusDiddingStatus = '未中标已总结'
                            } else {
                                statusDiddingStatus = ''
                            }
                            return statusDiddingStatus
                        }
                    }
                    , {
                        title: '操作', width: 140, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>详情</a>';
                            return optStr;
                        }
                    }
                ];
            } else if (layId === "8") {
                reqUrl = basePath + '/afterSummary/queryDataByCondition'; //请求数据接口
                viewUrl = basePath + '/afterSummary/toDealOrDetail';
                pageTitle = '标后总结';
                colsData = [
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'proCode', title: '项目编码', width: 145}
                    , {field: 'compName', title: '区域公司', width: 145}
                    , {field: 'proName', title: '项目名称'}
                    , {field: 'cityName', title: '项目城市', width: 155}
                    , {
                        field: 'addTime', title: '创建时间', width: 160, templet: function (d) {
                            return layui.util.toDateString(d.addTime, "yyyy-MM-dd");
                        }
                    }
                    , {field: 'staffName', title: '营销经理', width: 100}
                    , {
                        field: 'bidding', title: '是否中标', width: 150, templet: function (d) {
                            var status = '';
                            if (d.bidding == '1') {
                                status = '是'
                            } else if (d.bidding == '0') {
                                status = '否'
                            } else {
                                status = ''
                            }
                            return status
                        }
                    }
                    , {
                        field: 'processStatus', title: '审批状态', width: 150, templet: function (d) {
                            var status = '';
                            if (d.processStatus == '1') {
                                status = '审批中'
                            } else if (d.processStatus == '9') {
                                status = '审批完成'
                            } else if (d.processStatus == '10') {
                                status = '审批终止'
                            } else {
                                status = ''
                            }
                            return status
                        }
                    }
                    , {
                        title: '操作', width: 140, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>详情</a>';
                            return optStr;
                        }
                    }
                ];
            } else if (layId === "9") {
                reqUrl = basePath + '/disclosePro/queryDataByCondition'; //请求数据接口
                viewUrl = basePath + '/disclosePro/toDealOrDetail';
                pageTitle = "项目交底";
                colsData = [
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'proCode', title: '项目编码', width: 145}
                    , {field: 'compName', title: '区域公司', width: 145}
                    , {field: 'proName', title: '项目名称',}
                    , {field: 'cityName', title: '项目城市', width: 155}
                    , {
                        field: 'addTime', title: '创建时间', width: 160, templet: function (d) {
                            return layui.util.toDateString(d.addTime, "yyyy-MM-dd");
                        }
                    }
                    , {field: 'staffName', title: '营销经理', width: 100}
                    , {
                        field: 'discloseDate', title: '预计交底日期', width: 150, templet: function (d) {
                            return layui.util.toDateString(d.discloseDate, "yyyy-MM-dd");
                        }
                    }
                    , {
                        field: 'processStatus', title: '审批状态', width: 150, templet: function (d) {
                            var status = '';
                            if (d.processStatus == '1') {
                                status = '审批中'
                            } else if (d.processStatus == '9') {
                                status = '审批完成'
                            } else if (d.processStatus == '10') {
                                status = '审批终止'
                            } else {
                                status = ''
                            }
                            return status
                        }
                    }
                    , {
                        title: '操作', width: 140, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>详情</a>';
                            return optStr;
                        }
                    }
                ];
            } else if (layId === "10") {
                reqUrl = basePath + '/bidSubsidy/queryDataByCondition'; //请求数据接口
                viewUrl = basePath + '/bidSubsidy/toDealOrDetail';
                pageTitle = "投标补贴";
                colsData = [
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'proCode', title: '项目编码', width: 145}
                    , {field: 'compName', title: '区域公司', width: 145}
                    , {field: 'proName', title: '项目名称', width: 145}
                    , {field: 'cityName', title: '项目城市', width: 155}
                    , {
                        field: 'addTime', title: '创建时间', width: 160, templet: function (d) {
                            return layui.util.toDateString(d.addTime, "yyyy-MM-dd");
                        }
                    }
                    , {field: 'staffName', title: '营销经理', width: 100}
                    , {field: 'rewardAmount', title: '申请奖金金额', width: 150}
                    , {
                        field: 'processStatus', title: '审批状态', width: 150, templet: function (d) {
                            var status = '';
                            if (d.processStatus == '1') {
                                status = '审批中'
                            } else if (d.processStatus == '9') {
                                status = '审批完成'
                            } else if (d.processStatus == '10') {
                                status = '审批终止'
                            } else {
                                status = ''
                            }
                            return status
                        }
                    }
                    , {
                        title: '操作', width: 140, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>详情</a>';
                            return optStr;
                        }
                    }
                ];
            }

            // 表单
            table.render({
                elem: '#lay-' + tabTag + '-create-manage'
                , url: reqUrl
                , cols: [colsData]
                , page: true
                , limit: 10
            });
            form.on('submit(lay-' + tabTag + '-add)', function (data) {
                viewUrl = basePath + '/bidSubsidy/toDealOrDetail';
                parent.layui.index.openTabsPage(viewUrl + '?id=' + '', pageTitle + '> 详情');
            });
            //监听搜索
            form.on('submit(lay-' + tabTag + '-search)', function (data) {
                table.reload('lay-' + tabTag + '-create-manage', {
                    page: {curr: 1},
                    where: trimData(data)
                });
            });
            //重置清空
            form.on('submit(lay-' + tabTag + '-back-reset)', function (data) {
                reset_form(tabTag + '-query-form');
                //额外处理select
                $("#query-form-state").val('');
                form.render();
            });

            // 监听操作列
            table.on('tool(lay-' + tabTag + '-create-manage)', function (obj) {
                var data = obj.data;
                if (obj.event === 'view') {//查看详情
                    console.log(data.bondType)
                    parent.layui.index.openTabsPage(viewUrl + '?id=' + data.id + '&proCode=' + data.proCode + "&bondType=" + (data.bondType ? data.bondType : ''), pageTitle + '> 详情');
                } else if (obj.event === 'copy') {//复制单据
                    parent.layui.index.openTabsPage(basePath + '/inquiryPro/toCopy?id=' + data.id, '项目信息收集 > 复制单据');
                } else if (obj.event === 'del') {
                    layer.confirm('确定要删除？', {icon: 3, title: '提示'}, function (index) {
                        $.ajax({
                            type: 'post',
                            url: basePath + '/flowProcess/logicDel',
                            data: {
                                "processId": data.processId
                            },//数据，这里使用的是Json格式进行传输
                            success: function (result) {
                                if (result) {
                                    table.reload('lay-yxlx-create-manage'); //数据刷新
                                    layer.close(index); //关闭弹层
                                } else {
                                    layer.msg('数据通信异常~', {icon: 0});
                                }
                            }
                        });
                    })
                } else if (obj.event === 'recyclingMargin') {//回收保证金详情
                    viewUrl = basePath + '/bidBondRecycle/toDealOrDetail';
                    pageTitle = '保证金回收';
                    parent.layui.index.openTabsPage(viewUrl + '?proCode=' + data.proCode + '&bondApplyId=' + data.id, pageTitle + '> 详情');
                    console.log(111);
                } else if (obj.event === 'tenderReview') {//标书评审
                    if (data.bidType == 1) {
                        viewUrl = basePath + '/creditDetails/toDealOrDetail';
                        pageTitle = '资信标';
                        parent.layui.index.openTabsPage(viewUrl + '?proCode=' + data.proCode + '&id=' + data.id, pageTitle + '> 详情');
                        console.log('资信标')
                    } else if (data.bidType == 2) {
                        console.log('商务标')
                        viewUrl = basePath + '/business/toDealOrDetail';
                        pageTitle = '商务标';
                        parent.layui.index.openTabsPage(viewUrl + '?proCode=' + data.proCode + '&id=' + data.id, pageTitle + '> 详情');
                    } else {
                        viewUrl = basePath + '/technicalDetail/toDealOrDetail';
                        pageTitle = '技术标';
                        parent.layui.index.openTabsPage(viewUrl + '?proCode=' + data.proCode + '&id=' + data.id, pageTitle + '> 详情');
                    }
                }
            });


            table.on('tool(lay-tbgl-create-manage)', function (obj) {
                var data = obj.data;
                console.log(data)
                console.log(data.proCode);
                console.log(obj.event);
                if (obj.event === '0') {
                    if (data.inquiryId) {//资格预审
                        pageTitle = '资格预审';
                        viewUrl = basePath + '/inquiryPro/toDealOrDetail';
                        parent.layui.index.openTabsPage(viewUrl + '?id=' + data.inquiryId + '&proCode=' + data.proCode, pageTitle + '> 详情');
                    }
                } else if (obj.event === '1') {
                    if (data.analysisId) {//招标文件分析
                        pageTitle = '招标文件分析';
                        viewUrl = basePath + "/bidAnalysis/toDealOrDetail";
                        parent.layui.index.openTabsPage(viewUrl + '?id=' + data.analysisId + '&proCode=' + data.proCode, pageTitle + '> 详情');
                    }
                } else if (obj.event === '2') {
                    if (data.planId) {//标书策划
                        pageTitle = '标书策划';
                        viewUrl = basePath + "/bidPlan/toDealOrDetail";
                        parent.layui.index.openTabsPage(viewUrl + '?id=' + data.planId+ '&proCode=' + data.proCode, pageTitle + '> 详情');
                    }
                } else if (obj.event === '3') {
                    if (data.decisionId) {//投标决策
                        pageTitle = '投标决策';
                        viewUrl = basePath + '/bidDecision/toDealOrDetail';
                        parent.layui.index.openTabsPage(viewUrl + '?id=' + data.decisionId + '&proCode=' + data.proCode, pageTitle + '> 详情');
                    }
                } else if (obj.event === '4') {
                    if (data.bondApplyId) {//投标保证金支付申请
                        pageTitle = '投标保证金支付申请';
                        viewUrl = basePath + '/bidBondApply/toDealOrDetail';
                        parent.layui.index.openTabsPage(viewUrl + '?id='+ data.bondApplyId +'&proCode=' + data.proCode, pageTitle + '> 详情');
                    }
                } else if (obj.event === '5') {
                    if (data.busiStandId) {//商务标
                        pageTitle = '商务标';
                        viewUrl = basePath + '/business/toDealOrDetail';
                        parent.layui.index.openTabsPage(viewUrl + '?proCode=' + data.proCode + '&id=' + data.busiStandId, pageTitle + '> 详情');
                    }
                } else if (obj.event === '6') {
                    if (data.resultId) {//开标结果
                        pageTitle = '开标结果';
                        viewUrl = basePath + '/bidOpenResult/toDealOrDetail';
                        parent.layui.index.openTabsPage(viewUrl + '?id=' + data.resultId + '&proCode=' + data.proCode, pageTitle + '> 详情');
                    }
                } else if (obj.event === '7') {
                    if (data.summaryId) {//标后总结
                        pageTitle = '标后总结';
                        viewUrl = basePath + '/afterSummary/toDealOrDetail';
                        parent.layui.index.openTabsPage(viewUrl + '?id=' + data.summaryId + '&proCode=' + data.proCode, pageTitle + '> 详情');
                    }
                } else if (obj.event === '8') {
                    if (data.discloseId) {//项目交底
                        pageTitle = '项目交底';
                        viewUrl = basePath + '/disclosePro/toDealOrDetail';
                        parent.layui.index.openTabsPage(viewUrl + '?id=' + data.discloseId + '&proCode=' + data.proCode, pageTitle + '> 详情');
                    }
                } else if (obj.event === '9') {
                    if (data.subsidyId) {//投标补贴
                        pageTitle = '投标补贴';
                        viewUrl = basePath + '/bidSubsidy/toDealOrDetail';
                        parent.layui.index.openTabsPage(viewUrl + '?id=' + data.subsidyId + '&proCode=' + data.proCode, pageTitle + '> 详情');
                    }
                } else if (obj.event === '10') {
                    if (data.creditId) {//资信标
                        viewUrl = basePath + '/creditDetails/toDealOrDetail';
                        pageTitle = '资信标';
                        parent.layui.index.openTabsPage(viewUrl + '?proCode=' + data.proCode + '&id=' + data.creditId, pageTitle + '> 详情');
                    }
                } else if (obj.event === '11') {
                    if (data.technoLogyId) {//技术标
                        viewUrl = basePath + '/technicalDetail/toDealOrDetail';
                        pageTitle = '技术标';
                        parent.layui.index.openTabsPage(viewUrl + '?proCode=' + data.proCode + '&id=' + data.technoLogyId, pageTitle + '> 详情');
                    }
                }

            });
        }

        // data-type事件
        $('.layui-btn.layuiadmin-btn-admin').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
</script>
</body>
</html>

